<?php

class TemplateUser extends CI_Controller
{
	function index()
	{
		$data = array(
			'page'=>'home',
			'dsduandatc'=>$this->mduan->danhsachduandatc(),
			'dsduandangtc'=>$this->mduan->danhsachduandangtc(),
			'dsnews4'=>$this->mduan->danhsachtintuc4(),
		);
		$this->load->view('templateuser', $data);
		
	}
	
		
		function projects($kindid)
	{
		$data = array(
			'page'=>'projects',
			'dsprojects'=>$this->mduan->danhsachduan($kindid),
			'TenDA'=>$this->mduan->tenduancha($kindid)
						
		);
		$this->load->view('templateuser', $data);
	}
	
	function thoitiet($tp)
	{
		$city = $tp;
$url = "http://vnexpress.net/ListFile/Weather/".$city.".xml";
$thoitiet = new DOMDocument;
$thoitiet->load($url);
$img = $thoitiet->getElementsByTagName("AdImg")->item(0)->nodeValue;
$img1 = $thoitiet->getElementsByTagName("AdImg1")->item(0)->nodeValue;
$img2 = $thoitiet->getElementsByTagName("AdImg2")->item(0)->nodeValue;
$Weather = $thoitiet->getElementsByTagName("Weather")->item(0)->nodeValue;
$ct = $thoitiet->getElementsByTagName("City")->item(0)->nodeValue;

echo "	<div id='img-Do'><img src='http://vnexpress.net/Images/Weather/$img' />";
echo "<img src='http://vnexpress.net/Images/Weather/$img1' />";
echo "<img src='http://vnexpress.net/Images/Weather/$img2' />";
echo "<img alt='' class='img-weather' src='http://vnexpress.net/Images/Weather/c.gif'></div>";
echo "<div id='txt-Weather' style='font-size:11px'>".$Weather."</div>";
	}
	
	
	

	
	
	
}

?>